//
//  KCServiceCenter.m
//  Jade
//
//  Created by king on 2016/10/24.
//  Copyright © 2016年 KC. All rights reserved.
//

#import "KCServiceCenter.h"
#import "KCKit.h"
#import "KCStation.h"

@interface KCServiceCenter ()<KCStationDelegate>

@property(nonatomic,strong)KCStation *station;

@end

@implementation KCServiceCenter

+ (instancetype)shareInstance {
    
    static dispatch_once_t pred;
    static KCServiceCenter *service = nil;
    dispatch_once(&pred, ^{
        service = [[self alloc]init];
    });
    return service;
    
}

- (KCStation *)shareStation {
    if (!_station) {
        _station = [KCStation RegisterStation:KShareStation delegate:self];
    }
    return _station;
}

- (id)dispatch:(KCCargo *)cargo {
    
    if (cargo.cargoID == 0x01) {
        
        NSDictionary *dic = cargo.cargoObj;
        NSLog(@"%@",dic);
    
    }else if (cargo.cargoID == 0x03) {
    
        NSDictionary *dic = cargo.cargoObj;
        NSLog(@"%@",dic);
    
    }
//    else if (cargo.cargoID == 0x05) {
//
//        NSDictionary *dic = cargo.cargoObj;
//        if ([dic[HttpResult] intValue] == HTTPResultCode_100) {
//            [SVProgressHUD showSuccessWithStatus:@"已收藏"];
//        }else{
//            if (dic[HttpResultInfo]) [SVProgressHUD showInfoWithStatus:dic[HttpResultInfo]];
//            else                     [SVProgressHUD showErrorWithStatus:HTTP_FAIL_HINT];
//        }
//        NSLog(@"%@",dic);
//
//    }else if (cargo.cargoID == 0x08) {
//
//        KCLog(@"%@",cargo.cargoObj);
//        [SVProgressHUD showSuccessWithStatus:@"删除订单成功"];
//        [NOTIFICATION_CENTER postNotificationName:@"refreshOrder" object:nil];
//
//    }else if (cargo.cargoID == 0x12) {
//
//        KCLog(@"%@",cargo.cargoObj);
//        [SVProgressHUD showSuccessWithStatus:@"成功收货"];
//        [NOTIFICATION_CENTER postNotificationName:@"refreshOrder" object:nil];
//
//    }else if (cargo.cargoID == 0x13) {
//
//        [SVProgressHUD showInfoWithStatus:@"申请退货已提交,请等待客服沟通"];
//
//    }else if (cargo.cargoID == 0x20) {
//
//        [SVProgressHUD showSuccessWithStatus:@"删除拍卖订单成功"];
//        [NOTIFICATION_CENTER postNotificationName:@"refreshAuctionOrder" object:nil];
//
//    }
    
    return nil;
    
}

#pragma mark -------------------------------------------------------

- (void)followForService:(NSString *)code {


}

@end
